package com.shy.springframework.test.bean;

import com.shy.springframework.beans.BeansException;
import com.shy.springframework.beans.factory.*;
import com.shy.springframework.context.ApplicationContext;
import com.shy.springframework.context.ApplicationContextAware;

import java.util.Random;

/**
 * @author yzpang
 * @desc:
 * @date: 2023/2/7 13:43
 */
public class UserService implements IUserService {
    private String userName;
    public String  queryUserInfo(){
        try {
            Thread.sleep(new Random().nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("执行方法: queryUserInfo");
        return "查询用户: " + userName;
    }

    @Override
    public String registerName(String userName) {
        try {
            Thread.sleep(new Random().nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("方法执行: registerName");
        return "注册用户: " + userName;
    }
}
